public class Triangle extends shape
{
    double area(double a, double b, double c)
    {
        double p = (a + b + c) / 2;
        return Math.sqrt(p * (p - a) * (p - b) * (p - c));
    }

    double perimeter(double a, double b, double c)
    {
        return a + b + c;
    }

    String toString(double a, double b, double c)
    {
        return "三条边分别为:" + String.valueOf(a) + ","
                + String.valueOf(b) + "," + String.valueOf(c)
                + "的三角形面积为:" + String.valueOf(area(a, b, c))
                + "周长为:" + String.valueOf(perimeter(a, b, c));
    }
}


